<template>
  <!-- 游戏主页面 -->
  <div class="container-fluid w-100 h-100 px-0 mx-0">
    <window class="container-fluid w-100 h-100 px-0 mx-0" ref="window"></window>
    <div v-bind:class="{ 'gamepinfopc' : vdata.onpc, 'gamepinfoph' : !vdata.onpc }">
      <pstatus ref="pstatus"></pstatus>
      <pinfo ref="pinfo"></pinfo>
      <wheel ref="wheel"></wheel>
      <thing ref="thing"></thing>
    </div>
  </div>
</template>

<script>
/* eslint-disable comma-dangle */
import window from './Window.vue'
import pstatus from './Pstatus.vue'
import pinfo from './Pinfo.vue'
import wheel from './Wheel.vue'
import thing from './Thing.vue'

export default {
  name: 'Game',
  data: function () {
    return {
      vdata: this.gdata.data,
      keydir: {
        36: '西北',
        38: '北',
        33: '东北',
        37: '西',
        39: '东',
        35: '西南',
        40: '南',
        34: '东南',
        103: '西北',
        104: '北',
        105: '东北',
        100: '西',
        102: '东',
        97: '西南',
        98: '南',
        99: '东南'
      }
    }
  },
  mounted: function () {
  },
  components: {
    window: window,
    pstatus: pstatus,
    pinfo: pinfo,
    wheel: wheel,
    thing: thing,
  },
  methods: {
    onkeyevent: function (key) {
      // this.jxwdtext(key)
      var dir = this.keydir[key]
      if (typeof (dir) !== 'undefined') {
        this.$refs.wheel.onkeyeventdir(dir)
      }
    },
    G2C: function (pid, rsp, success, result) {
      switch (pid) {
        default:
          // 这里是没有找到对应的值处理
          break
      }
    }
  },
  watch: {
  }
}
</script>

<style scoped>
/* .gametxet {
  position: absolute;
  z-index: 200;
  right: 0;
  top: 0;
  width: 100%;
  height: 100%;
} */
.gamepinfopc {
  position: absolute;
  z-index: 300;
  right: 0;
  top: 0;
  width: 300px;
  height: auto;
}
.gamepinfoph {
  position: absolute;
  z-index: 300;
  right: 0;
  top: 0;
  width: 100px;
  height: auto;
}
</style>
